#-*- coding: utf-8 -*-
import unittest

import nosango.plugin    # Be sure to configure DJANGO_SETTINGS_MODULE

class Asserts(object):
    '''Be able to call asserts'''

    def _get_dj_tc(self):
        from django.test.testcases import TransactionTestCase
        class DJTC(TransactionTestCase):
            def __init__(self): pass
        return DJTC()
    
    def assertRedirects(self, *args, **kwargs): return self._get_dj_tc().assertRedirects(*args, **kwargs)
    
    def assertContains(self, *args, **kwargs): return self._get_dj_tc().assertContains(*args, **kwargs)
    
    def assertNotContains(self, *args, **kwargs): return self._get_dj_tc().assertNotContains(*args, **kwargs)
    
    def assertFormError(self, *args, **kwargs): return self._get_dj_tc().assertFormError(*args, **kwargs)
    
    def assertTemplateUsed(self, *args, **kwargs): return self._get_dj_tc().assertTemplateUsed(*args, **kwargs)
    
    def assertTemplateNotUsed(self, *args, **kwargs): return self._get_dj_tc().assertTemplateNotUsed(*args, **kwargs)
        
class TestCase(unittest.TestCase, Asserts):
    '''Classical test case with specific asserts'''
    pass
